const {create} = require("./register.service")
const {send} = require("@common/utils")


class RegisterController{
  async create(ctx,next){
   try {
    let {name ,password} = ctx.request.body
    let result = await create(name,password)
    if(result.affectedRows === 1){
      send(ctx,200,'200','用户注册成功')
    }

   } catch (error) {
    console.log(error);
   }
  }
}

module.exports = new RegisterController()